﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using BussinessLogic.Exercise;

namespace BussinessLogic.Models.Administrator
{
    public class CreateAdminModel
    {
        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email address")]
        public string Email { get; set; }
    }

    public class UserStudyApproveModel
    {
        public string UserName { get; set; }
        public string StudyName { get; set; }
        public int UserId { get; set; }
        public int StudyId { get; set; }
    }

    public class LockAccountModel
    {
        public int UserID { get; set; }
        public string UserName { get; set; }
        public string Name { get; set; }
    }

    public class UserInfo
    {
        public bool PendingApproval { get; set; }
        public int StudyId { get; set; }
        public int UserId { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Email { get; set; }
    }

    public class UserDetails
    {
        public int ID { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Email { get; set; }
        public List<UserStudyAdmin> Studies { get; set; }

        public string Phone { get; set; }


        public bool Active { get; set; }
    }

    public class UserStudyAdmin
    {
        public string StudyName { get; set; }
        public int StudyId { get; set; }
        public bool IsApproved { get; set; }

        public bool Waiting { get; set; }
    }

    public class UserStudyDetails
    {
        public int ID { get; set; }
        public string UserName { get; set; }
        public string StudyName { get; set; }
        public List<StudySessions> Sessions { get; set; }

    }

    public class StudySessions
    {
        public int ID { get; set; }
        public int Crt { get; set; }
        public DateTime Date { get; set; }

    }

    public class StudySessionDetail
    {
        public int ID { get; set; }
        public DateTime date { get; set; }
        public List<SessionExercise> exerciseTrials { get; set; }
    }

    public class SessionExercise
    {
        public string Name { get; set; }
        public ExerciseType ExType { get; set; }
        public List<SessionTrial> ExerciseTrials { get; set; }
        public List<SessionMatrixTrial> ExerciseMatrixTrials { get; set; }
        public QuestionnaireExercise Questionnaire { get; set; }
        public int QNTotalScore { get; set; }
    }

    public class QuestionnaireExercise
    {
        public int ID { get; set; }
        public List<ExQnQuestion> Questions { get; set; }
    }

    public class ExQnQuestion
    {
        public int ID { get; set; }
        public string Text { get; set; }
        public bool IsFreeAnswer { get; set; }
        public string FreeAnswer { get; set; }
        public int Score { get; set; }

        public int? FreeAnswerID { get; set; }
    }

    public enum ExerciseType
    {
        Questionnaire,
        Exercise,
        ExerciseMatrix
    }

    public class SessionTrial
    {
        public int ID { get; set; }
        public string Picture { get; set; }
        public Exercise.ExerciseTrial.LetterType Letter { get; set; }
        public Exercise.ExerciseTrial.Position LetterPosition { get; set; }
        public Exercise.ExerciseTrial.Position NeutralPosition { get; set; }
        public bool Convergent { get { return LetterPosition != NeutralPosition; } }
        public int Reaction { get; set; }
        public bool Correct { get; set; }
        public ExerciseTrial.SequenceType TrialType { get; set; }
        public int? Digit { get; set; }
        public string NeutralPicture { get; set; }
        public string NegativePicture { get; set; }
    }


    public class SessionMatrixTrial
    {
        public string Picture { get; set; }
        public int Reaction { get; set; }
    }

    public class SaveScore
    {
        public int ID { get; set; }
        public int Value { get; set; }
    }
}
